﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Toolkit.Web.ViewComponents.WebAssetRegistrar
{
    public class WebAsset : IWebAsset
    {
        public WebAsset(string source)
        {
            if (string.IsNullOrEmpty(source))
            {
                throw new ArgumentException("source");
            }

            Source = source;
        }

        public string FileName
        {
            get
            {
                return Path.GetFileName(Source);
            }
        }

        public string Version
        {
            get;
            set;
        }

        public string Source
        {
            get;
            private set;
        }

        public string FileExtension
        {
            get
            {
                return Path.GetExtension(Source);
            }
        }
    }
}
